<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('【请填写功能名称】列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <p>车牌号：</p>
                                <input type="text" name="cph"/>
                            </li>
                            <li>
                                <p>VIN 码：</p>
                                <input type="text" name="vin"/>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:car:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:car:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:car:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:car:export">
                    <i class="fa fa-download"></i> 导出
                 </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:car:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:car:remove')}]];
        var prefix = ctx + "system/car";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "【请填写功能名称】",
                columns: [{
                    checkbox: true
                },
                {
                    field : 'mid',
                    title : '序号',
                    visible: false
                },
                    {
                        field : 'cph',
                        title : '车牌号',
                    },
                {
                    field : 'vin',
                    title : 'VIN 码'
                },
                {
                    field : 'peizhiid',
                    title : '配置Id'
                },
                {
                    field : 'clzl',
                    title : '车辆种类'
                },
                {
                    field : 'clggxh',
                    title : '车辆公告型号'
                },
                {
                    field : 'gy',
                    title : '规约'
                },
                {
                    field : 'nvbh',
                    title : '内部编号'
                },
                {
                    field : 'yydw',
                    title : '运营单位'
                },
                {
                    field : 'yyqy',
                    title : '运营区域'
                },
                {
                    field : 'dcbh',
                    title : '电池编号'
                },
                {
                    field : 'dcxh',
                    title : '电池型号'
                },
                {
                    field : 'qddjxh',
                    title : '驱动电机型号'
                },
                {
                    field : 'zdxh',
                    title : '终端型号'
                },
                {
                    field : 'zdbh',
                    title : '终端编号'
                },
                {
                    field : 'iccd',
                    title : 'ICCID'
                },
                {
                    field : 'sim',
                    title : 'SIM卡号'
                },
                {
                    field : 'sccs',
                    title : '生产厂商'
                },
                {
                    field : 'scpc',
                    title : '生产批次'
                },
                {
                    field : 'spqy',
                    title : '上牌区域'
                },
                {
                    field : 'upDatea',
                    title : '上牌时间'
                },
                {
                    field : 'gcly',
                    title : '购车领域'
                },
                {
                    field : 'gmdw',
                    title : '购买单位'
                },
                {
                    field : 'cz',
                    title : '车主'
                },
                {
                    field : 'czdh',
                    title : '车主电话'
                },
                {
                    field : 'clyt',
                    title : '车辆用途'
                },
                {
                    field : 'clxsbh',
                    title : '车辆行驶编号'
                },
                {
                    field : 'goDatea',
                    title : '行驶证时间'
                },
                {
                    field : 'bfDatea',
                    title : '报废日期'
                },
                {
                    field : 'hsqy',
                    title : '回收企业'
                },
                {
                    field : 'cldjzt',
                    title : '车辆登记状态'
                },
                {
                    field : 'luruDatea',
                    title : '录入信息'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.mid + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.mid + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>
